package com.astrocsr.security;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.security.core.Authentication;
import org.springframework.security.web.authentication.logout.SimpleUrlLogoutSuccessHandler;

public class LogoutHandler extends
	SimpleUrlLogoutSuccessHandler {

	public LogoutHandler() {
	}

	public void onLogoutSuccess(HttpServletRequest request,
			HttpServletResponse response, Authentication authentication) {
		try {
			if (authentication != null ) {
				System.out.println("Catch Logout Successfully : " + authentication.getName());
			} else {
				System.out.println("User already logouted : ");
			}
			
			super.onLogoutSuccess(request, response, authentication);
		} catch (Exception e) {
			e.printStackTrace();
		} finally {

		}
	}
}
